package cn.edu.gzgs.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.time.LocalDateTime;

@TableName("user_known_ips")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UserKnownIp {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private Long userId;

    private String ipAddress;

    @Builder.Default
    private Integer loginCount = 1;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime firstLoginTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime lastLoginTime;

    @Builder.Default
    private Boolean isTrusted = false; // 默认为不信任，可以后续提供接口让用户标记
} 